import Message from 'ant-design-vue/lib/message';
import 'ant-design-vue/lib/message/style/css';
import router from '@/router/index'
const fun=(apiName,arg,cb)=>{
    apiName(arg).then(res=>{
        if(res.code===200){
            cb(res)
        }else if(res.code===418||res.code===427||res.code===428||res.code===443){
            Message.error(res.message+' 即将跳转至登录页')
            setTimeout(()=>{
                router.push({path:'/'})
            },1000)
        }else{
            Message.error(res.message)
        }
    }).catch(()=>{
        //Message.error('出错了')
    })
}
export default fun